package com.pine.app.module.security.oauth.support.implicit;


import com.pine.app.module.security.core.common.AuthConstant;
import com.pine.app.module.security.oauth.support.AbstractHttpTokenRequest;

import javax.servlet.http.HttpServletRequest;


/**
 * @author xiaoyuan
 * @create 2019/9/30 14:28
 **/
public class HttpImplicitRequest extends AbstractHttpTokenRequest implements ImplicitRequest {


    private String redirectUri;


    public HttpImplicitRequest(HttpServletRequest request) {
        super(request);
        this.redirectUri = this.parameters.get(AuthConstant.redirect_uri);

    }

    @Override
    public String getClientId() {
        return this.getClientCredentials().getCredentials();
    }

    @Override
    public String getClientSecret() {
        return this.getClientCredentials().getPrincipal();
    }

    @Override
    public String getRedirectUri() {
        return redirectUri;
    }

    @Override
    public  boolean enableRefresh() {
        return false;
    }
}
